(()=>{"use strict";var t,e={95686:(t,e,n)=>{var a=p(n(88209)),r=p(n(2958)),o=p(n(31934));n(96672),n(84200);var i=p(n(88640)),l=p(n(3787)),u=n(892),d=p(n(77183)),f=p(n(51585)),c=p(n(8543)),s=p(n(9500)),m=p(n(14554));function p(t){return t&&t.__esModule?t:{default:t}}o.default.extend(i.default),a.default.init(window.init),window.CTFd=a.default,window.helpers=m.default,window.$=r.default,window.dayjs=o.default,window.nunjucks=l.default,window.Howl=u.Howl,(0,r.default)((function(){(0,c.default)(),(0,s.default)(),(0,d.default)(f.default.urlRoot)}))},82422:(t,e,n)=>{n(95686);var a=n(80218),r=l(n(88209));n(26600);var o=l(n(2958)),i=n(7144);function l(t){return t&&t.__esModule?t:{default:t}}function u(t,e){if(t){if("string"==typeof t)return d(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(t,e):void 0}}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n<e;n++)a[n]=t[n];return a}function f(t,e){var n,a,r,o=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=u(t))){n&&(t=n);var a=0,r=function(){};return{s:r,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return i=t.done,t},e:function(t){l=!0,o=t},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw o}}}}(document.cookie.split("; "));try{for(o.s();!(n=o.n()).done;){var i=(a=n.value.split("="),r=2,function(t){if(Array.isArray(t))return t}(a)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var a,r,o,i,l=[],u=!0,d=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(a=o.call(n)).done)&&(l.push(a.value),l.length!==e);u=!0);}catch(t){d=!0,r=t}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(d)throw r}}return l}}(a,r)||u(a,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),l=i[0],d=i[1];if("Scr1wCTFdLanguage"===l)return"en"===decodeURIComponent(d)?t:e}}catch(t){o.e(t)}finally{o.f()}return e}(0,o.default)((function(){window.team_captain&&((0,o.default)(".edit-team").click((function(){(0,o.default)("#team-edit-modal").modal()})),(0,o.default)(".edit-captain").click((function(){(0,o.default)("#team-captain-modal").modal()})),(0,o.default)(".invite-members").click((function(){r.default.fetch("/api/v1/teams/me/members",{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}).then((function(t){return t.json()})).then((function(t){if(t.success){var e=t.data.code,n="".concat(window.location.origin).concat(r.default.config.urlRoot,"/teams/invite?code=").concat(e);(0,o.default)("#team-invite-modal input[name=link]").val(n),(0,o.default)("#team-invite-modal").modal()}}))})),(0,o.default)("#team-invite-link-copy").click((function(t){(0,a.copyToClipboard)(t,"#team-invite-link")})),(0,o.default)(".disband-team").click((function(){(0,i.ezQuery)({title:f("Disband Team","解散队伍"),body:f("Are you sure you want to disband your team?","你确定要解散你的队伍吗"),success:function(){r.default.fetch("/api/v1/teams/me",{method:"DELETE"}).then((function(t){return t.json()})).then((function(t){t.success?window.location.reload():(0,i.ezAlert)({title:f("Error","错误"),body:t.errors[""].join(" "),button:f("Got it!","好的")})}))}})})));var t=(0,o.default)("#team-info-form");t.submit((function(e){e.preventDefault(),(0,o.default)("#results").empty();var n=(0,o.default)(this).serializeJSON();for(var a in n.fields=[],n)if(a.match(/fields\[\d+\]/)){var i={},l=parseInt(a.slice(7,-1));i.field_id=l,i.value=n[a],n.fields.push(i),delete n[a]}r.default.fetch("/api/v1/teams/me",{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)}).then((function(e){400===e.status?e.json().then((function(e){if(!e.success){var n='<div class="alert alert-danger alert-dismissable" role="alert">\n  <span class="sr-only">'+f("Error:","错误：")+'</span>\n  {0}\n  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>\n</div>';Object.keys(e.errors).map((function(a){var r=t.find("input[name={0}]".format(a)),i=(0,o.default)(r);i.addClass("input-filled-invalid"),i.removeClass("input-filled-valid");var l=e.errors[a],u=n.format(l);(0,o.default)("#results").append(u)}))}})):200===e.status&&e.json().then((function(t){t.success&&window.location.reload()}))}))})),(0,o.default)("#team-captain-form").submit((function(t){t.preventDefault();var e=(0,o.default)("#team-captain-form").serializeJSON(!0);r.default.fetch("/api/v1/teams/me",{method:"PATCH",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then((function(t){return t.json()})).then((function(t){t.success?window.location.reload():((0,o.default)("#team-captain-form > #results").empty(),Object.keys(t.errors).forEach((function(e,n){(0,o.default)("#team-captain-form > #results").append((0,i.ezBadge)({type:"error",body:t.errors[e]}));var a=(0,o.default)("#team-captain-form").find("select[name={0}]".format(e)),r=(0,o.default)(a);r.addClass("input-filled-invalid"),r.removeClass("input-filled-valid")})))}))}))}))}},n={};function a(t){var r=n[t];if(void 0!==r)return r.exports;var o=n[t]={id:t,loaded:!1,exports:{}};return e[t](o,o.exports,a),o.loaded=!0,o.exports}a.m=e,t=[],a.O=(e,n,r,o)=>{if(!n){var i=1/0;for(f=0;f<t.length;f++){for(var[n,r,o]=t[f],l=!0,u=0;u<n.length;u++)(!1&o||i>=o)&&Object.keys(a.O).every((t=>a.O[t](n[u])))?n.splice(u--,1):(l=!1,o<i&&(i=o));if(l){t.splice(f--,1);var d=r();void 0!==d&&(e=d)}}return e}o=o||0;for(var f=t.length;f>0&&t[f-1][2]>o;f--)t[f]=t[f-1];t[f]=[n,r,o]},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),a.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{var t={695:0,671:0};a.O.j=e=>0===t[e];var e=(e,n)=>{var r,o,[i,l,u]=n,d=0;if(i.some((e=>0!==t[e]))){for(r in l)a.o(l,r)&&(a.m[r]=l[r]);if(u)var f=u(a)}for(e&&e(n);d<i.length;d++)o=i[d],a.o(t,o)&&t[o]&&t[o][0](),t[o]=0;return a.O(f)},n=self.webpackChunkctfd=self.webpackChunkctfd||[];n.forEach(e.bind(null,0)),n.push=e.bind(null,n.push.bind(n))})();var r=a.O(void 0,[736,788],(()=>a(82422)));r=a.O(r)})();